import auth from "../../serveapi/auth";
const permission={
    state:{
        auth: {},
        status:false

    },
    mutations:{
        SET_AUTH(state,auth){
            state.auth=auth;
        },
        SET_STATUS(state,status){
            state.status=status;
        }
    },
    getters:{
        GET_AUTH:state=>state.auth,
        GET_STATUS:state=>state.status
},
    actions:{
        async SET_AUTH({commit}, payload) {
            commit('SET_AUTH',payload);
        },
        async GET_AUTH({commit,state}){
            let data=await auth.getAuth();
            commit('SET_AUTH',data|| {});
            return state.auth;
        },
        async SET_STATUS({commit},payload){
            commit('SET_STATUS',payload);
        }
    }

}
export default permission